<template>
    <div v-if="fansInfo.length>0">已拥有{{fansInfo.length}}粉丝 </div>
  <a-list item-layout="horizontal" :data-source="fansInfo" >
    <template #renderItem="{ item }">
     
      <a-list-item>
        <a-list-item-meta
          :description="item.u_mark"
        >
          <template #title>
            <a :href="'/user/information?u_id=' + item.u_id">{{ item.u_name }}</a>
            <div style="display: flex">
              <div style="width: 20%">
                <!-- <a-tag color="#55acee">
                  {{ item.ut_name }}
                </a-tag> -->
              </div>
            </div>
          </template>
          <template #avatar>
            <a :href="'/user/information?u_id=' + item.u_id">
            <a-avatar :src="'/api/avatar/'+item.u_avatar" />
            </a>
          </template>
        </a-list-item-meta>
      </a-list-item>
    </template>
  </a-list>
</template>
<script setup>
import { get, post, put, del, tip } from "@/common";
import { ref, reactive, defineComponent } from "vue";

const CurrU_id = ref();
const getCurrU_id = () => {
  get("/user/home/curr-user3").then((res) => {
    CurrU_id.value = res.data.u_id;
    getFansInfo();
    console.log(CurrU_id.value);
  });
};
const fansInfo = ref([]);
const getFansInfo = () => {
  let u_id = window.location.search.split("=")[1];
  if (u_id) {
    get("/user/myself/fans/" + u_id).then((res) => {
      fansInfo.value = res.data;
    });
  } else {
    get("/user/myself/fans/" + CurrU_id.value).then((res) => {
      fansInfo.value = res.data;
    });
  }
};

getCurrU_id();
</script>